<template>
	<view class="doctorInfo">
		<view class="doctorBox">
			<view class="info">
				<image src="../../../static/images/index.png" mode=""></image>
				<view>
					{{storeDoctor.selDoctorData.doctorName}}
					<text>{{storeDoctor.selDoctorData.title}}</text>
				</view>
			</view>
			<view class="edit">
				医生简介：消化系统的疾病的治疗，擅长肝胆疾病的治疗；消化系统的疾病的治疗，擅长肝胆疾病的治疗
			</view>
			<view class="adept">
				<view class="green">糖尿病</view>
				<view class="orange">尿毒症</view>
				<view class="red">肾病</view>
			</view>
		</view>
		<view class="title">医生全部排班</view>
		<view class="arrange">
			<view class="position">东院</view>
			<view class="date" v-for="v in gastrologyData" :key="v.date">
				<view class="left">
					<view class="left-detail">
						{{ v.date }}
						<text>{{ v.day }}</text>
					</view>
					<view class="price">{{ v.price }}</view>
				</view>
				<button
					class="right"
					:class="v.remain == '约满' ? 'active' : ' '"
					@click="toggle"
				>
					{{ v.remain }}
				</button>
			</view>
			<uni-popup ref="popupCoupon" type="bottom" background-color="#fff">
				<view class="titleCon">选择预约时间段</view>
				<view class="tag">上午号源</view>
				<view class="before">
					<view class="box" @click="goConfirmReserveInfo">
						9:00 剩余10
					</view>
					<view class="disabled">9:30 剩余0</view>
					<view class="box">10:00 剩余30</view>
				</view>
				<view class="before">
					<view class="box">10:30 剩余5</view>
					<view class="box">11:00 剩余8</view>
					<view class="disabled">11:30 剩余0</view>
				</view>
				<view class="tag">下午号源</view>
				<view class="before">
					<view class="box">13:30 剩余12</view>
					<view class="disabled">14:00 剩余0</view>
					<view class="disabled">14:30 剩余0</view>
				</view>
				<view class="before">
					<view class="box">15:00 剩余15</view>
					<view class="box">15:30 剩余32</view>
					<view class="disabled">16:30 剩余0</view>
				</view>
				<view class="before">
					<view class="box">17:00 剩余7</view>
					<view class="box">17:30 剩余8</view>
					<view class="box">18:00 剩余30</view>
				</view>
			</uni-popup>
		</view>
		<view class="title">更多同科室医生</view>
		<view class="otherDoctor" @click="goDoctorInfo">
			<view class="doctor-top" v-for="v in doctorData" :key="v.name">
				<image :src="v.src"></image>
				<view class="content" @click="goDoctorInfo">
					<view>
						{{ v.name }}
						<text>{{ v.status }}</text>
					</view>
					<text>{{ v.main }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import { ref, reactive,onMounted } from 'vue'
import {
		selPersonStore
	} from '@/store/appReStore.js'
	import {doctorRange} from '@/api/AppointmentRegisterAPI.js'
	let storeDoctor = selPersonStore();
let gastrologyData = reactive([
	{
		date: '2022-11-13',
		day: '2天后',
		price: '￥60',
		remain: '剩余30'
	},
	{
		date: '2022-11-15',
		day: '4天后',
		price: '￥60',
		remain: '约满'
	},
	{
		date: '2022-11-17',
		day: '6天后',
		price: '￥60',
		remain: '剩余30'
	}
])
let doctorData = reactive([
	{
		src: '../../../static/images/mytwo.png',
		name: '张三',
		status: '主任医师',
		main: '消化系统的疾病的治疗，擅长肝胆疾病的治疗'
	},
	{
		src: '../../../static/images/index.png',
		name: '李四',
		status: '助手',
		main: '消化系统的疾病的治疗，擅长肝胆疾病的治疗'
	},
	{
		src: '../../../static/images/logo.png',
		name: '刘萌萌',
		status: '主任专家',
		main: '消化系统的疾病的治疗，擅长肝胆疾病的治疗'
	}
])

let popupCoupon = ref(null)
let toggle = () => {
	popupCoupon.value.open('bottom')
}
// let doctorData = reactive({
// 		doctorRangeData: []
// 	});
// 排班信息
// doctorRange({
// 	doctorId:storeDoctor.selDoctorData.doctorId
// }).then((res)=>{
// 	console.log('ceshi',res)
// 	if(res.data.msg=='success'){
// 		doctorData.doctorRangeData = res.data.data
// 		console.log('123456',doctorData.doctorRange);
// 	}
// })
// 跳转到确认预约信息
let goConfirmReserveInfo = () => {
	uni.navigateTo({
		url: '/pages/nucleicAcidTesting/confirmReserveInfo/confirmReserveInfo'
	})
}
// 跳转到医生信息
let goDoctorInfo = () => {
	uni.navigateTo({
		url: '/pages/appointmentRegister/doctorInfo/doctorInfo'
	})
}
onMounted(() => {
		console.log('doctor',storeDoctor.selDoctorData);
	})
</script>

<style scoped="" lang="less">
.doctorInfo {
	width: 750rpx;
	margin: 0 24rpx;

	.doctorBox {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: space-between;
		border: 1px #f4f4f4 solid;
		width: 670rpx;
		padding: 22rpx;
		height: 254rpx;

		.info {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			flex-wrap: wrap;

			image {
				width: 70rpx;
				height: 70rpx;
				border-radius: 4rpx;
			}

			view {
				color: #5c645b;
				font-size: 30rpx;
				margin-left: 26rpx;

				text {
					color: #717677;
					font-size: 26rpx;
					margin-left: 14rpx;
				}
			}
		}

		.edit {
			color: #b8b8cd;
			font-size: 24rpx;
		}

		.adept {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			font-size: 22rpx;

			.green {
				color: #83d9ac;
				background-color: #ebfbf2;
				width: 128rpx;
				height: 36rpx;
				text-align: center;
				line-height: 36rpx;
				border-radius: 18rpx;
			}

			.orange {
				color: #ffa992;
				background-color: #fff4eb;
				margin: 14rpx;
				width: 128rpx;
				height: 36rpx;
				text-align: center;
				line-height: 36rpx;
				border-radius: 18rpx;
			}

			.red {
				color: #f46363fc;
				background-color: #fff1f0;
				width: 128rpx;
				height: 36rpx;
				text-align: center;
				line-height: 36rpx;
				border-radius: 18rpx;
			}
		}
	}

	.title {
		margin: 26rpx 0;
		font-size: 28rpx;
	}

	.arrange {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		border: 1px #f4f4f4 solid;
		width: 670rpx;

		.position {
			font-size: 26rpx;
			border-bottom: 1px #f4f4f4 solid;
			width: 670rpx;
			height: 102rpx;
			line-height: 102rpx;
			margin-left: 30rpx;
		}

		.date {
			width: 670rpx;
			background-color: #f8f8f8;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1px #ddd solid;
			height: 102rpx;

			.left {
				font-size: 22rpx;
				margin-left: 30rpx;

				.left-detail {
					text {
						width: 108rpx;
						height: 30rpx;
						text-align: center;
						background-color: #e5ecf8;
						color: #006eff;
						margin-left: 20rpx;
					}
				}

				.price {
					color: #f46363fc;
					padding: 10rpx 0;
				}
			}

			.right {
				font-size: 26rpx;
				background-color: #006eff;
				color: #fff;
				width: 126rpx;
				height: 42rpx;
				line-height: 42rpx;
				text-align: center;
				border-radius: 6rpx;
				margin-right: 24rpx;
				padding: 0;
			}
		}

		.active {
			font-size: 26rpx;
			background-color: #f2f2f2;
			color: #aaa;
			width: 126rpx;
			height: 42rpx;
			line-height: 42rpx;
			text-align: center;
			border-radius: 6rpx;
			margin-right: 24rpx;
		}
	}
}

.otherDoctor {
	border: 1px #f4f4f4 solid;
	width: 670rpx;

	.doctor-top {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		border-bottom: 1px #f4f4f4 solid;
		padding-bottom: 30rpx;

		image {
			width: 90rpx;
			height: 74rpx;
			border-radius: 6rpx;
			margin: 0 22rpx;
		}

		.content {
			display: flex;
			flex-direction: column;
			align-items: flex-start;
			justify-content: flex-start;

			view {
				font-size: 30rpx;
				color: #313131;
				padding-bottom: 28rpx;

				text {
					font-size: 24rpx;
					color: #6f6f6f;
					margin-left: 10rpx;
				}
			}

			text {
				font-size: 24rpx;
				color: #cfcfcf;
			}
		}
	}
}

.titleCon {
	font-size: 34rpx;
	text-align: center;
	margin: 44rpx 0;
}

.tag {
	font-size: 22rpx;
	color: #7b7c7c;
	margin: 22rpx 0 40rpx 22rpx;
}

.before {
	display: flex;
	align-items: center;
	justify-content: space-around;
	margin: 22rpx 12rpx;

	.box {
		width: 188rpx;
		height: 70rpx;
		background-color: #f1f7ff;
		color: #0f63ff;
		font-size: 20rpx;
		text-align: center;
		line-height: 70rpx;
	}

	.disabled {
		width: 188rpx;
		height: 70rpx;
		background-color: #f2f2f2;
		color: #a1a7ba;
		font-size: 20rpx;
		text-align: center;
		line-height: 70rpx;
	}
}
</style>
